import Network from '@/utils/request'

// 获取角色列表数据
// params是查询参数，里面需要携带分页信息
export const getRoleList = (page, pagesize) => Network.get(`/sys/role?page=${page}&pagesize=${pagesize}`)
// 获取公司信息
// companyId 是从获取用户信息里的companyId
export const getCompanyInfo = (companyId) => Network.get(`/company/${companyId}`)
// 删除角色
export const deleteRole = (id) => Network.delete(`/sys/role/${id}`)
// 修改角色
export const updateRole = (data) => Network.put(`/sys/role/${data.id}`, data)
// 获取角色详情
export const getRoleDetail = (id) => Network.get(`/sys/role/${id}`)
// 新增角色
export const addRole = (data) => Network.post('/sys/role', data)
// 给角色分配权限
export const assignPerm = (data) => Network.put('/sys/role/assignPrem', data)
